<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>主菜单</title>
    <jsp:include page="/common/meta.jsp"></jsp:include>
    <jsp:include page="/common/resource.jsp"></jsp:include>
</head>
<script>
    $(function () {
        /*布局部分*/
        $('#master-layout').layout({
            fit: true/*布局框架全屏*/
        });
        /*右侧菜单控制部分*/
        var left_control_status = true;
        var left_control_panel = $("#master-layout").layout("panel", 'west');
        $(".left-control-switch").on("click", function () {
            if (left_control_status) {
                left_control_panel.panel('resize', {width: 70});
                left_control_status = false;
                $(".theme-left-normal").hide();
                $(".theme-left-minimal").show();
            } else {
                left_control_panel.panel('resize', {width: 200});
                left_control_status = true;
                $(".theme-left-normal").show();
                $(".theme-left-minimal").hide();
            }
            $("#master-layout").layout('resize', {width: '100%'})
        });
        /*右侧菜单控制结束*/
        $(".theme-navigate-user-modify").on("click", function () {
            $('.theme-navigate-user-panel').menu('hide');
            $.insdep.window({id: "personal-set-window", href: "user.html", title: "修改资料"});
        });
        //$.insdep.control("list.html");
        var cc1 = $('#cc1').combo('panel');
        cc1.panel({cls: "theme-navigate-combobox-panel"});
        var cc2 = $('#cc2').combo('panel');
        cc2.panel({cls: "theme-navigate-combobox-panel"});
        /*$("#open-layout").on("click",function(){
                var option = {
                    "region":"west",
                    "split":true,
                    "title":"title",
                    "width":180
                };
                $('#master-layout').layout('add', option);

        });*/
        //initInfo();
    });

    function indexDoSearch(value, name) {
        alert('You input: ' + value + '(' + name + ')');
    }
    /** 退出方法*/
    function logOut() {
        window.location.href = "${base}/dologinout";
    }
</script>
<body>
<div id="master-layout">
    <div data-options="region:'north',border:false,bodyCls:'theme-header-layout'">
        <div class="theme-navigate">
            <div class="left">
                <a href="#" class="easyui-linkbutton left-control-switch"><i class="fa fa-bars fa-lg"></i></a>
                <a href="#" class="easyui-menubutton theme-navigate-user-button" data-options="menu:'.theme-navigate-user-panel'">${sessionScope._CURRENT_USER.view_name}</a>
                <a href="#" class="easyui-linkbutton">新建</a>
                <a href="#" class="easyui-menubutton" data-options="menu:'#mm1',hasDownArrow:false">文件</a>
                <a href="#" class="easyui-menubutton" data-options="menu:'#mm2',hasDownArrow:false">编辑</a>
                <a href="#" class="easyui-menubutton" data-options="menu:'#mm3',hasDownArrow:false">消息<span class="badge color-default">15</span></a>

                <select id="cc1" class="easyui-combobox theme-navigate-combobox" name="dept" style="width:120px;">
                    <option>选择样式</option>
                    <option>Insdep</option>
                    <option>Bootstrap</option>
                    <option>Gray</option>
                    <option>Metro</option>
                    <option>Material</option>
                </select>

                <div id="mm1" class="theme-navigate-menu-panel">
                    <div>新建</div>
                    <div>打开</div>
                    <div>
                        <span>打开最近文件</span>
                        <div>
                            <div>1 index.html</div>
                            <div>2 calendar-custom.html</div>
                            <div>3 combo-animation.html</div>
                            <div>4 datebox-restrict.html</div>
                            <div>5 datetimespinner-icon.html</div>
                            <div>6 filebox-button-align.html</div>
                            <div>7 menubutton-alignment.html</div>
                            <div>8 messager-interactive.html</div>
                            <div>9 propertygrid-group-format.html</div>
                            <div class="menu-sep"></div>
                            <div>启动时重新打开文件</div>
                        </div>
                    </div>
                    <div>关闭</div>
                    <div>全部关闭</div>
                    <div class="menu-sep"></div>
                    <div data-options="disabled:true,iconCls:'icon-save'">保存</div>
                    <div>另存为</div>
                    <div data-options="disabled:true">保存为全部</div>
                    <div class="menu-sep"></div>
                    <div>
                        <span>导入</span>
                        <div>
                            <div>XML 到模板</div>
                            <div>表格式数据</div>
                            <div data-options="disabled:true">Word 文档</div>
                            <div data-options="disabled:true">Excel 文档</div>
                        </div>
                    </div>
                    <div>
                        <span>导出</span>
                        <div>
                            <div>表格</div>
                        </div>
                    </div>
                    <div class="menu-sep"></div>
                    <div>退出</div>
                </div>

                <div id="mm2" class="theme-navigate-menu-panel">
                    <div>撤销</div>
                    <div data-options="disabled:true">重做</div>
                    <div class="menu-sep"></div>
                    <div>剪切</div>
                    <div>复制</div>
                    <div data-options="disabled:true">粘贴</div>
                    <div data-options="disabled:true">选择性粘贴</div>
                    <div data-options="disabled:true">清除</div>
                    <div class="menu-sep"></div>
                    <div>全选</div>
                    <div>选择父标签</div>
                    <div>选择子标签</div>
                    <div class="menu-sep"></div>
                    <div>查找和替换</div>
                    <div>查找所选</div>
                    <div>查找下一个</div>
                    <div class="menu-sep"></div>
                    <div>快捷键</div>
                    <div>首选项</div>
                </div>

                <div id="mm3" class="theme-navigate-menu-panel" style="width:180px;">
                    <div>产品消息<span class="badge color-success">5</span></div>
                    <div>安全消息<span class="badge color-important">10</span></div>
                    <div>服务消息</div>
                    <div class="menu-sep"></div>
                    <div>查看历史消息</div>
                    <div class="menu-sep"></div>
                    <div>清除消息提示</div>
                </div>


                <div class="theme-navigate-user-panel">
                    <dl>
                        <dd>
                            <img src="themes/css/images/portrait86x86.png" width="86" height="86">
                            <b class="badge-prompt">${sessionScope._CURRENT_USER.view_name}<i class="badge color-important">10</i></b>
                            <span>examples@insdep.com</span>
                            <p>安全等级：<i class="text-success">高</i></p>
                        </dd>
                        <dt>
                            <a class="theme-navigate-user-modify">修改资料</a>
                            <a class="theme-navigate-user-logout" onclick="logOut()">注销</a>
                        </dt>
                    </dl>
                </div>
            </div>
            <div class="right">
                <select id="cc2" class="easyui-combobox theme-navigate-combobox" name="dept" style="width:180px;">
                    <option>Choose a language</option>
                    <option>Chinese</option>
                    <option>English</option>
                    <option>Korean</option>
                    <option>Japanese</option>
                    <option>Arabic</option>
                </select>
                <input class="easyui-searchbox theme-navigate-search" data-options="prompt:'输入搜索的关键词..',menu:'#mm',searcher:indexDoSearch" style="width:300px"></input>
                <a href="#" class="easyui-menubutton theme-navigate-more-button" data-options="menu:'#more',hasDownArrow:false"></a>
                <div id="more" class="theme-navigate-more-panel">
                    <div>联系我们</div>
                    <div>参与改进计划</div>
                    <div>检测更新</div>
                    <div>关于</div>
                </div>
                <div id="mm" class="theme-navigate-menu-panel">
                    <div data-options="name:'all'">全部内容</div>
                    <div data-options="name:'sports'">标题</div>
                    <div data-options="name:'sports'">作者</div>
                    <div data-options="name:'sports'">内容</div>
                </div>
            </div>
        </div>
    </div>
    <!--开始左侧菜单-->
    <div data-options="region:'west',border:false,bodyCls:'theme-left-layout'" style="width:200px;">
        <!--正常菜单-->
        <div class="theme-left-normal">
            <!--theme-left-switch 如果不需要缩进按钮，删除该对象即可-->
            <div class="left-control-switch theme-left-switch"><i class="fa fa-chevron-left fa-lg" style="line-height: 2.25em;"></i></div>

            <!--start class="easyui-layout"-->
            <div class="easyui-layout" data-options="border:false,fit:true">
                <!--start region:'north'-->
                <div data-options="region:'north',border:false" style="height:106px;">
                    <!--start theme-left-user-panel-->
                    <div class="theme-left-user-panel">
                        <dl>
                            <dt>
                                <c:if test="${sessionScope._CURRENT_USER.icon_url == '' || sessionScope._CURRENT_USER.icon_url == null }">
                                    <img src="themes/css/images/portrait86x86.png" width="43" height="43">
                                </c:if>
                                <!-- 如果有头像，显示用户的头像，如果没有，显示默认的头像-->
                                <c:if test="${sessionScope._CURRENT_USER.icon_url != '' && sessionScope._CURRENT_USER.icon_url != null}">
                                    <img src="data:image/png;base64,${sessionScope._CURRENT_USER.icon_url}" width="43" height="43">
                                </c:if>
                            </dt>
                            <dd>
                                <b class="badge-prompt">${sessionScope._CURRENT_USER.view_name}<i class="badge color-important">10</i></b>
                                <span>examples</span>
                                <p>安全等级：<i class="text-success">高</i></p>
                            </dd>

                        </dl>
                    </div>
                    <!--end theme-left-user-panel-->
                </div>
                <!--end region:'north'-->
                <!--start region:'center'-->
                <div data-options="region:'center',border:false">

                    <!--start easyui-accordion-->
                    <div class="easyui-accordion" data-options="border:false,fit:true">
                        <!--  循环一级菜单 fontIcon -->
                        <c:forEach items="${sessionScope._CURRENT_USER.modulesList}" var="big">
                            <c:if test="${big.up_id== -1}">
                                <div title="${big.name}">
                                    <ul class="easyui-datalist" data-options="border:false,fit:true">
                                        <!-- 循环二级菜单 -->
                                        <c:forEach items="${sessionScope._CURRENT_USER.modulesList}" var="small">
                                            <c:if test="${ big.id==small.up_id }">
                                                <%--  href="${base}/${small.url}" --%>
                                                <li><a href="${base}/${small.url}" target="center_frame">${small.name}</a></li>
                                            </c:if>
                                        </c:forEach>
                                    </ul>
                                </div>
                            </c:if>
                        </c:forEach>
                        <%--<div title="测试菜单">--%>
                                <%--<ul class="easyui-datalist" data-options="border:false,fit:true">--%>
                                    <%--<li><a href="${base}/system/module/ModuleController/goIndexPage" target="center_frame">模块管理</a></li>--%>
                                    <%--<li><a href="${base}/system/role/RoleController/goIndexPage" target="center_frame">角色管理</a></li>--%>

                                <%--</ul>--%>

                        <%--</div>--%>

                    </div>
                    <!--end easyui-accordion-->
                </div>
                <!--end region:'center'-->
            </div>
            <!--end class="easyui-layout"-->
        </div>
        <!--最小化菜单-->
        <div class="theme-left-minimal">
            <ul class="easyui-datalist" data-options="border:false,fit:true">
                <li><i class="fa fa-home fa-2x"></i>
                    <p>主题</p></li>
                <li><i class="fa fa-book fa-2x"></i>
                    <p>组件</p></li>
                <li><i class="fa fa-pencil fa-2x"></i>
                    <p>编辑</p></li>
                <li><i class="fa fa-cog fa-2x"></i>
                    <p>设置</p></li>
                <li><a class="left-control-switch"><i class="fa fa-chevron-right fa-2x"></i>
                    <p>打开</p></a></li>
            </ul>
        </div>
    </div>
    <!--结束左侧菜单-->
    <!-- 右侧frame开始-->
    <div data-options="region:'center',border:false" id="control" style="padding:10px; background:#fff;">
        <iframe id="center_frame" name="center_frame" src="pages/init/info.jsp" frameborder="0" scrolling="auto" style="width:100%;height:100%;">
        </iframe>
    </div>
</div>
</body>
</html>
